import request from '../../utils/request'
import { LockDayDto } from '../personalChannel'

/**
 * 分页获取新车线索列表
 * @param {number} page 页数 
 * @param {string} brand 品牌
 */
export const getNewCarCluePage = async (page: number, brand: string) => request(`/api/wxnewcarclue/page?page=${page}&brand=${brand}`, 'GET') as Promise<PageResult<ListNewCarClue[]>>

/**
 * 获取新车线索详情
 * @param {number} id id 
 */
export const getNewCarClueDetail = async (id: string) => request(`/api/wxnewcarclue?id=${id}`, 'GET') as Promise<Result<ListNewCarClue>>

/**
 * 锁定线索
 * @param {LockDayDto} data 
 */
export const lockClue = (data: LockDayDto) => request(`/api/wxnewcarclue/lock`, 'POST', data)

export const checkOuted = (id: string) => request(`/api/wxnewcarclue/checkOut/${id}`, 'GET') as Promise<Result<boolean>>

export const checkExpire = (id: string) => request(`/api/wxnewcarclue/expire/${id}`, 'GET') as Promise<Result<boolean>>